Skip to content

Conversation

@r4f4
Copy link
Contributor

@r4f4 r4f4 commented Mar 16, 2022

Try to use the new Graph API but fallback to the old one in case the Graph perm Applications.ReadWrite.OwnedBy is not yet granted.

Tested with Azure Public Cloud and Openshift 4.9.23.

@openshift-ci openshift-ci bot requested review from jhixson74 and jstuever March 16, 2022 19:33
@r4f4
Copy link
Contributor Author

r4f4 commented Mar 16, 2022

/test e2e-azurestack

@r4f4
Copy link
Contributor Author

r4f4 commented Mar 16, 2022

/test e2e-azurestack

@patrickdillon
Copy link
Contributor

/test e2e-azure

Copy link
Contributor

@patrickdillon patrickdillon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work. I left a few comments but have not had a chance to review everything.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As this RequestAdapter is particular to the Graph client, I think it fits the pattern better to move this out of the Session and to where you are initializing the client: 26566c9#diff-a2fdf21d9b56bf657a0251ad81376851d27e5b801510337c8f5c9d2cd6495885R83-R87

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is that to create a GraphRequestAdapter I need an AzureIdentityAuthenticationProvider which in turn needs an azidentity.ClientSecretCredential. So either I save in the session:

  1. the request adapter itself,
  2. the authentication provider,
  3. the client secret credential.
    Which one would you rather pick, 2 or 3?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 because it is common across (the new) clients.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed it from the session altogether since it's only used in one place for now. When more places start using it we can share it through the session.

@patrickdillon
Copy link
Contributor

/hold

The deprecation of the graph API has been extended until at least openshift 4.12, which will give us more time to wait for the graph go client to stabilize.

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 22, 2022
@openshift-ci openshift-ci bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 31, 2022
@openshift-ci openshift-ci bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 1, 2022
@openshift-ci openshift-ci bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 13, 2022
@openshift-ci openshift-ci bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 14, 2022
@r4f4
Copy link
Contributor Author

r4f4 commented Jun 15, 2022

imports github.com/Azure/azure-sdk-for-go/sdk/azcore: build constraints exclude all Go files in /go/src/github.com/openshift/installer/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore

Starting with pre-release v0.23.0 [1], azcore now requires golang-1.18 for the use of generics. So we need to either bump our golang version requirement or use pre-release <= v0.22.0.

[1] https://github.com/Azure/azure-sdk-for-go/releases/tag/sdk%2Fazcore%2Fv0.23.0

@openshift-ci openshift-ci bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 24, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jun 24, 2022

@r4f4: PR needs rebase.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 14, 2022
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 6, 2022
@jstuever
Copy link
Contributor

/cc @patrickdillon
/uncc

@openshift-ci openshift-ci bot requested review from patrickdillon and removed request for jstuever October 12, 2022 16:08
r4f4 added 2 commits November 22, 2022 09:36
Microsoft is in the process of upgrading the Azure SDK for Go from V1 to
V2. Our clients and authentication are on V1. The V1 authentication
utilizes ADAL which will be deprecated June 30, 2022. All V2 clients,
except the V2 auth client azidentity, are in beta (azidentity is
scheduled to be stable in Q2 2022). [0]

These changes remove the dependency on the ADAL API, replace the
authentication with azidentity, and use an adapter so the auth will work
with V1 clients.

[0] https://azure.github.io/azure-sdk/releases/latest/index.html#go

https://issues.redhat.com/browse/CORS-1910
Notice that azblob also had to be upgraded to 0.4.1, otherwise we hit
the following build issue:

vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/zc_blob_lease_client.go:25:16: undefined: to.StringPtr
vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/zc_block_blob_client.go:145:20: undefined: to.StringPtr
vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/zc_container_lease_client.go:25:16: undefined: to.StringPtr
vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/zc_shared_policy_shared_key_credential.go:190:17: undefined: log.EventResponse
vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/zm_lease_request_options.go:63:16: undefined: to.StringPtr
vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/zm_lease_request_options.go:142:16: undefined: to.StringPtr

and newer versions cause

pkg/gather/azure/azure.go:224:29: undefined: azblob.NewBlobClientWithSharedKey
pkg/gather/azure/azure.go:235:48: unknown field 'MaxRetryRequests' in struct literal of type blob.RetryReaderOptions
AD Graph API is being deprecated. This change tries to use the new
MSGraph API to delete Applications and Service Principals. If there is
an authentication error, we try the legacy AD Graph API, just in case
(e.g, if clients haven't yet added the MSGraph permissions
to their Azure subscription).

https://issues.redhat.com/browse/CORS-1897
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 23, 2022
@r4f4
Copy link
Contributor Author

r4f4 commented Nov 23, 2022

Depends on #6003

/hold

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 23, 2022

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from r4f4 by writing /assign @r4f4 in a comment. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 1, 2022

@r4f4: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/okd-e2e-aws-upgrade af56d768e26d9d2330c2724685ac25ff42c2f2d1 link false /test okd-e2e-aws-upgrade
ci/prow/e2e-openstack-proxy ca29c1a26c0c0507692e37a9edc7fd14ea6ed350 link false /test e2e-openstack-proxy
ci/prow/e2e-aws-workers-rhel8 ca29c1a26c0c0507692e37a9edc7fd14ea6ed350 link false /test e2e-aws-workers-rhel8
ci/prow/e2e-aws-upgrade af56d768e26d9d2330c2724685ac25ff42c2f2d1 link true /test e2e-aws-upgrade
ci/prow/e2e-openstack-parallel ca29c1a26c0c0507692e37a9edc7fd14ea6ed350 link false /test e2e-openstack-parallel
ci/prow/e2e-gcp-shared-vpc ca29c1a26c0c0507692e37a9edc7fd14ea6ed350 link false /test e2e-gcp-shared-vpc
ci/prow/e2e-aws-single-node ca29c1a26c0c0507692e37a9edc7fd14ea6ed350 link false /test e2e-aws-single-node
ci/prow/e2e-gcp-upi-xpn ca29c1a26c0c0507692e37a9edc7fd14ea6ed350 link false /test e2e-gcp-upi-xpn
ci/prow/e2e-aws-proxy ca29c1a26c0c0507692e37a9edc7fd14ea6ed350 link false /test e2e-aws-proxy
ci/prow/e2e-aws-disruptive ca29c1a26c0c0507692e37a9edc7fd14ea6ed350 link false /test e2e-aws-disruptive
ci/prow/e2e-aws-shared-vpc ca29c1a26c0c0507692e37a9edc7fd14ea6ed350 link false /test e2e-aws-shared-vpc
ci/prow/e2e-gcp-upgrade af56d768e26d9d2330c2724685ac25ff42c2f2d1 link true /test e2e-gcp-upgrade
ci/prow/openstack-manifests ca29c1a26c0c0507692e37a9edc7fd14ea6ed350 link true /test openstack-manifests
ci/prow/e2e-metal-ipi-ovn-ipv6 ca29c1a26c0c0507692e37a9edc7fd14ea6ed350 link true /test e2e-metal-ipi-ovn-ipv6
ci/prow/e2e-crc 8a31839b4640716b752f04a145f0f3ba517e67c4 link false /test e2e-crc
ci/prow/e2e-azure-resourcegroup 8a31839b4640716b752f04a145f0f3ba517e67c4 link false /test e2e-azure-resourcegroup
ci/prow/e2e-azure-shared-vpc 8a31839b4640716b752f04a145f0f3ba517e67c4 link false /test e2e-azure-shared-vpc
ci/prow/e2e-ibmcloud 8a31839b4640716b752f04a145f0f3ba517e67c4 link false /test e2e-ibmcloud
ci/prow/okd-e2e-aws 8a31839b4640716b752f04a145f0f3ba517e67c4 link false /test okd-e2e-aws
ci/prow/e2e-gcp-upi 8a31839b4640716b752f04a145f0f3ba517e67c4 link true /test e2e-gcp-upi
ci/prow/e2e-aws-upi 8a31839b4640716b752f04a145f0f3ba517e67c4 link true /test e2e-aws-upi
ci/prow/e2e-azure-upi 8a31839b4640716b752f04a145f0f3ba517e67c4 link true /test e2e-azure-upi
ci/prow/e2e-aws 8a31839b4640716b752f04a145f0f3ba517e67c4 link true /test e2e-aws
ci/prow/e2e-gcp 8a31839b4640716b752f04a145f0f3ba517e67c4 link true /test e2e-gcp
ci/prow/e2e-vsphere 8a31839b4640716b752f04a145f0f3ba517e67c4 link true /test e2e-vsphere
ci/prow/e2e-azure 8a31839b4640716b752f04a145f0f3ba517e67c4 link true /test e2e-azure
ci/prow/okd-e2e-gcp-ovn-upgrade f1aa4e3c63ddf862469162e64972eb86fc05f1f1 link false /test okd-e2e-gcp-ovn-upgrade
ci/prow/e2e-azurestack e389b12 link false /test e2e-azurestack
ci/prow/okd-scos-e2e-aws-upgrade e389b12 link false /test okd-scos-e2e-aws-upgrade
ci/prow/e2e-vsphere-ovn e389b12 link true /test e2e-vsphere-ovn
ci/prow/e2e-aws-ovn-disruptive e389b12 link false /test e2e-aws-ovn-disruptive
ci/prow/e2e-openstack e389b12 link false /test e2e-openstack
ci/prow/okd-scos-images e389b12 link true /test okd-scos-images
ci/prow/e2e-azure-ovn-shared-vpc e389b12 link false /test e2e-azure-ovn-shared-vpc
ci/prow/e2e-ovirt-sdn e389b12 link false /test e2e-ovirt-sdn
ci/prow/okd-scos-e2e-aws-ovn e389b12 link false /test okd-scos-e2e-aws-ovn
ci/prow/e2e-azure-ovn e389b12 link true /test e2e-azure-ovn
ci/prow/e2e-ibmcloud-ovn e389b12 link false /test e2e-ibmcloud-ovn
ci/prow/e2e-aws-ovn-workers-rhel8 e389b12 link false /test e2e-aws-ovn-workers-rhel8
ci/prow/okd-e2e-aws-ovn-upgrade e389b12 link false /test okd-e2e-aws-ovn-upgrade
ci/prow/okd-unit e389b12 link true /test okd-unit
ci/prow/e2e-libvirt e389b12 link false /test e2e-libvirt
ci/prow/e2e-agent-sno e389b12 link false /test e2e-agent-sno
ci/prow/e2e-gcp-ovn e389b12 link true /test e2e-gcp-ovn
ci/prow/e2e-metal-assisted e389b12 link false /test e2e-metal-assisted
ci/prow/e2e-azure-ovn-resourcegroup e389b12 link false /test e2e-azure-ovn-resourcegroup
ci/prow/e2e-agent-compact-ipv4 e389b12 link true /test e2e-agent-compact-ipv4

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@patrickdillon
Copy link
Contributor

/close
in favor of #6614

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 8, 2022
@openshift-merge-robot
Copy link
Contributor

@r4f4: PR needs rebase.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci openshift-ci bot closed this Dec 8, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 8, 2022

@patrickdillon: Closed this PR.

Details

In response to this:

/close
in favor of #6614

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants